package cn.com.lms.business.learning.persistence.entity.vo;

/*
 * @author liuwei
 * @date 2020/4/8 16:52
 * @desc 员工学习计划统计-考试列表VO
 */

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

@Data
public class UserExamListVo {

    @Schema(description = "考试名称")
    private String examName;
    @Schema(description = "起止时间")
    private Date startDate;
    @Schema(description = "结束时间")
    private Date endDate;
    @Schema(description = "考试次数")
    private Number examCount;
    @Schema(description = "最近交卷时间")
    private Date lastExamTime;
    @Schema(description = "考试成绩")
    private Number grade;
    @Schema(description = "通过分数")
    private Number adoptScore;

    @Schema(description = "通过状态")
    private String stateText;


    public Number getGrade() {
        return grade;
    }

    public String getStateText() {
        return stateText;
    }

    public Number getAdoptScore() {
        return adoptScore;
    }

    public void setAdoptScore(Number adoptScore) {
        this.adoptScore = adoptScore;
        setStateText("未通过");
        if (null != adoptScore && null != getGrade()) {
            setStateText(getGrade().intValue() >= this.getAdoptScore().intValue() ? "通过" : "未通过");
        }
    }

    public void setGrade(Number grade) {
        this.grade = grade;
    }

    public void setStateText(String stateText) {
        this.stateText = stateText;
    }

}
